<template>
  <div>
    <h2>我是Home的内容</h2>
    <div>
      <ul class="nav nav-tabs">
        <li>
          <!--子路由这里to属性要写完整路由-->
          <router-link class="list-group-item" active-class="active" to="/home/news">News</router-link>
        </li>
        <li>
          <router-link class="list-group-item" active-class="active" to="/home/message">Message</router-link>
        </li>
      </ul>
      <!--这里定义子路由展示组件的位置-->
      <router-view>
      </router-view>
    </div>
  </div>
</template>

<script>
export default {
  name: "Home",
  mounted() {
    console.log('Home组件挂载完毕')
  },
  beforeDestroy() {
    console.log('Home组件即将被销毁')
  }
}
</script>

<style scoped>
</style>
